Next | Prev | Up | Top | Contents | Index
Dispatch Cycle
When the device driver interrupt handler exits, the kernel returns to a user process. This may be the same process that was interrupted, or a different one.
Adjust Scheduler Queue
Typically, the result of the interrupt is to make a sleeping process runnable. The runnable process is entered in one of the scheduler queues. (This work may be done while still within the interrupt handler, as part of a device driver library routine such as wakeup().)
Switch Processes
If the CPU was idling when the interrupt arrived, and if the interrupt has made a process runnable, the kernel spends some time setting up the context of the process to be run.
If the CPU has not been made nonpreemptive (see "Making a CPU Nonpreemptive"), and if the interrupt has made a superior-priority process runnable, the interrupted process will be preempted. The kernel has to save the context of the inferior-priority process before setting up the context of the new process.
If the CPU has been made nonpreemptive, there is no process switch. The kernel always returns to the interrupted process, if there was one.
In short, the kernel may spend time saving the context of one process, and may spend time setting up the context of another process.
Note: In a CPU controlled by the Frame Scheduler, control always returns to the interrupted process in minimal time.
Mode Switch
A number of instructions are required to exit kernel mode and resume execution of the user process. Among other things, this is the time the kernel looks for software signals addressed to this process, and redirects control to the signal handler. If a signal handler is to be entered, the kernel might have to extend the size of the stack segment. (This cannot happen if the stack was extended before it was locked; see "Locking Program Text and Data".)
Next | Prev | Up | Top | Contents | Index